Data setup

In this section, all the required libraries are read, and the data is uploaded in r.

Now the data is loaded

setwd("C:/Users/user/Desktop/Biologie/Master/Thesis/Thesis/data/raw")
maaginhoud <- as.tibble(read.csv("C:/Users/user/Desktop/Biologie/Master/Thesis/Thesis/data/raw/Maaginhoud.csv", sep = ";", dec = ",")) # leest de ruwe dataset (count van maaginhoud)
## Warning: `as.tibble()` is deprecated, use `as_tibble()` (but mind the new semantics).
## This warning is displayed once per session.
head(maaginhoud)
## # A tibble: 6 x 77
##      nr Potje.staart.ve~ Potje.Maaginhoud datum Locatie Gewicht.Glasaal
##   <int> <fct>                       <int> <fct> <fct>             <dbl>
## 1    60 A                               1 24/0~ PG-KR             0.211
## 2   278 A                               1 12/0~ MI-RO-~           0.294
## 3   215 A                               1 5/05~ MI-RO-~           0.211
## 4   183 A                               1 28/0~ PG-LO-~           0.147
## 5   219 A                               1 12/0~ PG-RO-~           0.227
## 6   242 A                               1 15/0~ PG-LO-~           0.2  
## # ... with 71 more variables: Gewicht.maag.darmstelsel <dbl>,
## #   Opmerkingen <fct>, Microplastics.Contaminatie.vezels..katoen.. <int>,
## #   X <lgl>, Cladocera.sp. <int>, X.1 <lgl>, Annelida <int>, X.2 <lgl>,
## #   Polychaete <int>, X.3 <lgl>, Isopoda <int>, X.4 <lgl>,
## #   Diptera.sp. <int>, X.5 <lgl>, Chironomide.thummi.plummosus <int>,
## #   X.6 <lgl>, Crustaceae.sp. <int>, X.7 <lgl>, Cycloida.sp. <int>,
## #   X.8 <lgl>, Invertebrata..larve..sp. <int>, X.9 <lgl>,
## #   Daphnidae.sp...ingekapseld. <int>, X.10 <lgl>,
## #   Cladocera.sp...Chydorus.sphaericus. <int>, X.11 <lgl>,
## #   Amphipoda.sp. <int>, X.12 <lgl>,
## #   Calanoide.Copepode..Pseudocalanus.elongatus. <int>, X.13 <lgl>,
## #   Gammarus <int>, X.14 <lgl>, Calanoide.copepode <int>, X.15 <lgl>,
## #   unidentifiable.eggs <int>, X.16 <lgl>, Copepoda.sp. <int>, X.17 <lgl>,
## #   Copepoda..Oithona.similis..male. <int>, X.18 <lgl>,
## #   Harpacticoid.Copepod <int>, X.19 <lgl>, Pleuroxus.sp. <int>,
## #   X.20 <lgl>, Chydorus.sp. <int>, X.21 <lgl>,
## #   Detritus.plantenafval <int>, X.22 <lgl>, Plantae.sp. <int>,
## #   X.23 <lgl>, Pennate.diatomee <int>, X.24 <lgl>,
## #   Detritus.met.schimmelfilamenten <int>, X.25 <lgl>,
## #   Invertebrate.sp. <int>, X.26 <lgl>, Hexapode.sp.... <int>, X.27 <lgl>,
## #   keverlarve <int>, X.28 <lgl>, Chironomide..Non.thummi.plumosus. <int>,
## #   X.29 <lgl>, Nereis.sp. <int>, X.30 <lgl>,
## #   Amphipode..Atylus.sp.. <int>, X.31 <lgl>, Chironomide.sp. <int>,
## #   X.32 <lgl>, Simulium.sp. <int>, X.33 <lgl>, X.34 <lgl>
maaginhoud2 <- as.tibble(read.csv("C:/Users/user/Desktop/Biologie/Master/Thesis/Thesis/data/raw/Maaginhoud2.csv", sep = ";", dec = ","))
head(maaginhoud2)
## # A tibble: 6 x 24
##      nr datum Locatie Locatie_A Locatie_Oever Methode Microplastics.C~
##   <int> <fct> <fct>   <fct>     <fct>         <fct>              <int>
## 1    60 24/0~ PG-KR   Pompgema~ midden        Kruisn~                1
## 2   278 12/0~ MI-RO-~ Midden VA RO            Substr~                0
## 3   215 5/05~ MI-RO-~ Midden VA RO            Substr~                0
## 4   183 28/0~ PG-LO-~ Pompgema~ LO            Substr~                1
## 5   219 12/0~ PG-RO-~ Pompgema~ RO            Paling~                0
## 6   242 15/0~ PG-LO-~ Pompgema~ LO            Paling~                0
## # ... with 17 more variables: Cladocera.sp. <int>, Annelida <int>,
## #   Polychaete <int>, Isopoda <int>, Diptera.sp. <int>,
## #   Chironomida.sp. <int>, Crustaceae.sp. <int>, Cycloida.sp. <int>,
## #   Unidentified.sp. <int>, Amphipoda.sp. <int>, Calanoida.sp. <int>,
## #   Copepoda.sp. <int>, Harpacticoid.Copepod <int>, Hexapode.sp.... <int>,
## #   keverlarve <int>, Pennate.diatomee <int>, Plantae.sp. <int>
data_inbo <- as.tibble(read.csv("C:/Users/user/Desktop/Biologie/Master/Thesis/Thesis/data/raw/Glass eel stock deepfreeze 2017.csv", sep = ";", dec = ",")) # leest de data van het inbo genoteerd bij de glasaalstaalname
head(data_inbo)
## # A tibble: 6 x 22
##      nr Date  Location Catchment.method length..mm. weight.mg.
##   <int> <fct> <fct>    <fct>                  <int>      <int>
## 1     1 10/0~ VA_PG_R~ Palinggoot                77        347
## 2     2 10/0~ VA_PG_R~ Palinggoot                74        315
## 3     3 10/0~ VA_PG_R~ Palinggoot                70        265
## 4     4 10/0~ VA_PG_R~ Palinggoot                68        266
## 5     5 10/0~ VA_PG_R~ Palinggoot                76        356
## 6     6 11/0~ VA_PG_L~ Palinggoot                66        313
## # ... with 16 more variables: pigmentation.stage <fct>,
## #   condition.factor <dbl>, Food.visible <fct>, remarks <fct>, X <lgl>,
## #   X.1 <fct>, X.2 <lgl>, X.3 <lgl>, X.4 <lgl>, X.5 <fct>, X.6 <lgl>,
## #   X.7 <lgl>, X.8 <lgl>, X.9 <lgl>, X.10 <lgl>, X.11 <lgl>

And then we can start exploring!

Visual Exploration

Environmental Data from INBO

## Warning: position_stack requires non-overlapping x intervals

## Warning: position_stack requires non-overlapping x intervals

## Warning: position_stack requires non-overlapping x intervals

Sampling location

At which locality are most glass eel caught?

VA_PG_LO_PA: Veurne Ambacht canal pumping station left bank eel ladder VA_PG_RO_PA: Veurne Ambacht canal pumping station right bank eel ladder VA_PG_LO_SU: Veurne Ambacht canal pumping station left bank substrates VA_PG_RO_SU: Veurne Ambacht canal pumping station right bank substrates VA_MI_LO_SU: Veurne Ambacht canal middle left bank substrates VA_MI_RO_SU: Veurne Ambacht canal middle right bank substrates VA_SC_LO_SU: Veurne Ambacht canal sluicecomplex Ganzepoot left bank substrates VA_SC_RO_SU: Veurne Ambacht canal sluicecomplex Ganzepoot right bank substrates VA_PG_KR_NA: Veurne Ambacht canal pumpingstation liftnets night GA_SU: Ganzepoot substrates

Onderstaande code werkt niet en is eigenlijk overbodig

Piecharts

https://www.zevross.com/blog/2017/06/19/tips-and-tricks-for-working-with-images-and-figures-in-r-markdown-documents/

colnames <- c("Microplastics.Contaminatie.vezels..katoen..", "Cladocera.sp.", "Annelida", "Polychaete", "Isopoda", "Diptera.sp.", "Chironomida.sp.", "Crustaceae.sp.", "Cycloida.sp.", "Unidentified.sp.", 'Amphipoda.sp.', 'Calanoida.sp.', "Copepoda.sp.", "Harpacticoid.Copepod", "Hexapode.sp....", "keverlarve", "Pennate.diatomee","Plantae.sp.")

for (i in 1:length(colnames)) {
  bp <- ggplot(maaginhoud2, aes_string(x="''", y = colnames[i], fill = "Methode")) +
    geom_bar(width = 1, stat="identity")
  pie <- bp + coord_polar("y", start= 0)
  print(pie)
}
## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

for (i in 1:length(colnames)) {
  bp <- ggplot(maaginhoud2, aes_string(x="''", y = colnames[i], fill = "Locatie_A")) +
    geom_bar(width = 1, stat="identity")
  pie <- bp + coord_polar("y", start= 0)
  print(pie)
}
## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

But now, we want to constructs piecharts which are not absolute numbers, but relative numbers. For example, if a glass eel ate 1 polychaete out of the total of 50 found polychaetes, this results in a relative number on the pie chart of 2%

maaginhoud2 <- remove_empty(maaginhoud2, 'rows')
col_sum <- colSums(maaginhoud2[7:24], na.rm = TRUE)

maaginhoud3 <- maaginhoud2[1:6]
new_column <- list()

for (count in 7:length(maaginhoud2)) {
  print(count)
  new_column <- (maaginhoud2[count] / col_sum[count - 6])
  maaginhoud3 <- cbind(maaginhoud3, new_column)
}
## [1] 7
## [1] 8
## [1] 9
## [1] 10
## [1] 11
## [1] 12
## [1] 13
## [1] 14
## [1] 15
## [1] 16
## [1] 17
## [1] 18
## [1] 19
## [1] 20
## [1] 21
## [1] 22
## [1] 23
## [1] 24
for (i in 1:length(colnames)) {
  bp <- ggplot(maaginhoud3, aes_string(x="''", y = colnames[i], fill = "Methode")) +
    geom_bar(width = 1, stat="identity")
  pie <- bp + coord_polar("y", start= 0)
  print(pie)
}
## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

for (i in 1:length(colnames)) {
  bp <- ggplot(maaginhoud3, aes_string(x="''", y = colnames[i], fill = "Locatie_A")) +
    geom_bar(width = 1, stat="identity")
  pie <- bp + coord_polar("y", start= 0)
  print(pie)
}
## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

Now we want to compose relative piecharts divided according to pigmentation stage

data_inbo_pigmentation <- data_inbo[,c("nr","pigmentation.stage")]
maaginhoud4 <- left_join(maaginhoud2, data_inbo_pigmentation, by='nr')

for (i in 1:length(colnames)) {
  bp <- ggplot(maaginhoud4, aes_string(x="''", y = colnames[i], fill = "pigmentation.stage")) +
    geom_bar(width = 1, stat="identity")
  pie <- bp + coord_polar("y", start= 0)
  print(pie)
}
## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

Now we want to compare what the relative percentage caught per method & location is To do so, we need a transposed data table. This needs some more work

Bargraphs

Now we want to represent this for the different food groups over the time series

for (i in 1:length(colnames)) {
  bp <- ggplot(maaginhoud4, aes_string(x=week(as.Date(maaginhoud4$datum)), y = colnames[i], fill = "pigmentation.stage")) +
    geom_bar(width = 1, stat="identity") +
    xlab(label = "Week of 2017")
  print(bp)
}
## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

## Warning: Removed 36 rows containing missing values (position_stack).

Environmental samples

environment2016_ind <- as.tibble(read.csv("C:/Users/user/Desktop/Biologie/Master/Thesis/Thesis/data/raw/Individuals per liter 2016.csv", sep = ";", header = TRUE, dec = ","))

env_cyclo <- ggplot(environment2016_ind, aes(week(as.Date(Datum)), Cyclopoida)) +
  geom_point() +
  ylab("Cyclopoida ind/L 2016")
env_cyclo

env_alona_a <- ggplot(environment2016_ind, aes(week(Datum), Alona.affinis)) +
  geom_point() +
  ylab("Alona affinis ind/L 2016")
env_alona_a

env_alona_r <- ggplot(environment2016_ind, aes(week(Datum), Alona.rectangula)) +
  geom_point() +
  ylab("Alona rectangula ind/L 2016")
env_alona_r

env_chydorus <- ggplot(environment2016_ind, aes(week(Datum), Chydorus.sphaericus)) +
  geom_point() +
  ylab("Chydorus sphaericus ind/L 2016")
env_chydorus

env_daphnia <- ggplot(environment2016_ind, aes(week(Datum), Daphnia.galeata)) +
  geom_point() +
  ylab("Daphnia galeata ind/L 2016")
env_daphnia 

env_pleuroxus <- ggplot(environment2016_ind, aes(week(Datum), Pleuroxus.aduncus)) +
  geom_point() +
  ylab("Pleuroxus aduncus ind/L 2016")
env_pleuroxus

Indices

Here, we calculate some indices from the dataset and visually explore these.

Condition Factor

First, the condition factor is analysed. Condition factor is already a variable in the dataset, calculated by the INBO

plot_condfact_method <- ggplot(data_inbo, aes(week(Date), condition.factor)) +
  geom_point() +
  ggtitle("Condition factor of glass eel vs week of catchment") +
  facet_grid(.~Catchment.method)
plot_condfact_method

plot_condfact_location <- ggplot(data_inbo, aes(week(Date), condition.factor)) +
  geom_point() +
  ggtitle("Condition factor of glass eel vs week of catchment") +
  facet_grid(.~Location)
plot_condfact_location

plot_condfact_pigm <- ggplot(data_inbo, aes(pigmentation.stage, condition.factor)) +
  geom_point() +
  ggtitle("Condition factor of glass eel vs week of catchment") 
plot_condfact_pigm

Ratio visceral organs/total body mass

Second, we calculate the ratio of visceral organs on total body mass.

maaginhoud6 <- select(maaginhoud, nr, datum, Gewicht.Glasaal, Gewicht.maag.darmstelsel)
maaginhoud6 <- mutate(maaginhoud6, ratio_visceral_total = Gewicht.maag.darmstelsel / Gewicht.Glasaal)

plot_ratio_method <- ggplot(maaginhoud6, aes(week(as.Date(datum)), ratio_visceral_total)) +
  geom_point() +
  ggtitle("Ratio of visceral organs on total body mass of glass eel vs week of catchment") 
plot_ratio_method 
## Warning: Removed 77 rows containing missing values (geom_point).

# Dikke outlier wegwerken

maaginhoud6_wo_outlier <- filter(maaginhoud6, ratio_visceral_total < 1)
plot_ratio_method <- ggplot(maaginhoud6_wo_outlier, aes(week(as.Date(datum)), ratio_visceral_total)) +
  geom_point() +
  ggtitle("Ratio of visceral organs on total body mass of glass eel vs week of catchment") 
plot_ratio_method 
## Warning: Removed 2 rows containing missing values (geom_point).

According to previous plot, glass eel do tend to be more fed at the end of spring. This is true for all catchment methods & locations. But is this really the case?

nr_locatie_methode <- select(maaginhoud2, nr, Locatie_A, Locatie_Oever, Methode)
nr_pigmentation_condfact <- select(data_inbo, nr, pigmentation.stage, condition.factor)
maaginhoud7 <- left_join(maaginhoud6_wo_outlier, nr_locatie_methode, by='nr')
maaginhoud7 <- left_join(maaginhoud7, nr_pigmentation_condfact, by='nr')

plot_ratio_location <- ggplot(maaginhoud7, aes(week(as.Date(datum)), ratio_visceral_total)) +
  geom_point() +
  ggtitle("Ratio of visceral organs on total body mass of glass eel vs week of catchment") +
  facet_grid(.~Locatie_A)
plot_ratio_location
## Warning: Removed 2 rows containing missing values (geom_point).

plot_ratio_method <- ggplot(maaginhoud7, aes(week(as.Date(datum)), ratio_visceral_total)) +
  geom_point() +
  ggtitle("Ratio of visceral organs on total body mass of glass eel vs week of catchment") +
  facet_grid(.~Methode)
plot_ratio_method
## Warning: Removed 2 rows containing missing values (geom_point).

plot_ratio_location2 <- ggplot(maaginhoud7, aes(week(as.Date(datum)), ratio_visceral_total)) +
  geom_point() +
  ggtitle("Ratio of visceral organs on total body mass of glass eel vs week of catchment") +
  facet_grid(.~Locatie_Oever) 
plot_ratio_location2
## Warning: Removed 2 rows containing missing values (geom_point).

plot_ratio_pigm_methode <- ggplot(maaginhoud7, aes(pigmentation.stage, ratio_visceral_total, fill = Methode)) +
  geom_boxplot() +
  ggtitle("Ratio of visceral organs on total body mass of glass eel vs pigmentation stage") 
plot_ratio_pigm_methode

plot_ratio_pigm_locatie <- ggplot(maaginhoud7, aes(pigmentation.stage, ratio_visceral_total, fill = Locatie_A)) +
  geom_boxplot() +
  ggtitle("Ratio of visceral organs on total body mass of glass eel vs pigmentation stage") 
plot_ratio_pigm_locatie

plot_ratio_pigm_methode <- ggplot(maaginhoud7, aes(pigmentation.stage, ratio_visceral_total, fill = Methode)) +
  geom_boxplot() +
  ggtitle("Ratio of visceral organs on total body mass of glass eel vs pigmentation stage") +
  facet_grid(.~Locatie_A)
plot_ratio_pigm_methode

And indeed, it is the case across methods and locations.However, data from the pompgemaal is probably most reliable, since not all pigmentation stages were caught at other locations, and only substrates were used to catch glass eels.

Fulness Index

Next, the Fulness Index is calculated.

Species Accumulation plot & Fun with VEGAN

http://spatialecology.weebly.com/r-code--data/category/plotting

library(vegan)
## Warning: package 'vegan' was built under R version 3.4.4
## Loading required package: permute
## Warning: package 'permute' was built under R version 3.4.4
## Loading required package: lattice
## Warning: package 'lattice' was built under R version 3.4.4
## This is vegan 2.5-4
maaginhoud8 <- select(maaginhoud2, Microplastics.Contaminatie.vezels..katoen..:Plantae.sp.)

accurve<-specaccum(maaginhoud8, method="random", permutations=100)
#plot(accurve$sites, accurve$richness, xlab="Number of glass eel analysed", ylab="Species Richness")

PCA

PCA as exploration of the stomach analysis data

https://www.datacamp.com/community/tutorials/pca-analysis-r

maaginhoud2.pca <- prcomp(na.omit(maaginhoud2[7:24]), center = TRUE, scale. = TRUE)
str(maaginhoud2.pca)
## List of 5
##  $ sdev    : num [1:18] 1.4 1.31 1.29 1.18 1.14 ...
##  $ rotation: num [1:18, 1:18] -0.395 -0.364 0.125 -0.382 0.111 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:18] "Microplastics.Contaminatie.vezels..katoen.." "Cladocera.sp." "Annelida" "Polychaete" ...
##   .. ..$ : chr [1:18] "PC1" "PC2" "PC3" "PC4" ...
##  $ center  : Named num [1:18] 0.16216 0.53604 0.0045 0.37838 0.00901 ...
##   ..- attr(*, "names")= chr [1:18] "Microplastics.Contaminatie.vezels..katoen.." "Cladocera.sp." "Annelida" "Polychaete" ...
##  $ scale   : Named num [1:18] 0.4368 2.3314 0.0671 0.6933 0.0947 ...
##   ..- attr(*, "names")= chr [1:18] "Microplastics.Contaminatie.vezels..katoen.." "Cladocera.sp." "Annelida" "Polychaete" ...
##  $ x       : num [1:222, 1:18] -0.132 0.22 0.22 -0.132 3.655 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : NULL
##   .. ..$ : chr [1:18] "PC1" "PC2" "PC3" "PC4" ...
##  - attr(*, "class")= chr "prcomp"
ggbiplot(maaginhoud2.pca)